<?php include "../public/header.php"?>
<?php include "../public/header_public.php"?>
<body class="laytp-container">
<div style="height: 45px"></div>
<div id="opt_nav">
</div>
<div id="dialog">
    <div class="page-title" id="page-title">
        <div class="page-title-con">
            <span class="title">副本信息</span>
            <div class="move_title"></div>
            <div class="page-title-opt-list">
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
</div>
<div class="layui-card" id="table-card">
    <div class="layui-card-body">
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-card-body">
                    <table id="datalist" lay-filter="datalist"></table>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/html" id="test-dropdown-toolbar-barDemo">
    <div class="tab-list-authbut">
        <a href="javascript:;" class="bar_opt" onclick="auth_but_func_show('查看','{{d.LAY_TABLE_INDEX}}')">查看</a>
        <a href="javascript:;" class="bar_opt" onclick="auth_but_func_edit('{{d.id}}')">编辑</a>
        <a href="javascript:;" class="bar_opt" onclick="auth_but_func_delete('{{d.id}}')">删除</a>
    </div>
</script>
<script type="text/html" id="toolbarDemo">
    <div class = "layui-btn-container">
        <button class="layui-btn layui-btn-primary outbut" onclick="auth_but_func_add('新建副本')">
            <i class="layui-icon layui-icon-add-1"></i>新建副本
        </button>
    </div>
</script>
<script>
    var parent_pid = getQueryVariable('id') || 0;
    var parent_name = decodeURI(getQueryVariable('name') || '') || '';

    layui.use(["tree",'table','form','soulTable'], function () {
        var tree = layui.tree, table = layui.table, form = layui.form, soulTable = layui.soulTable;

        $('#TableSearchReset').click(function () {
            $('.xmselect_div>xm-select').find('.xm-label-block').css('display','none');
            $('.xmselect_div').append('<div class="xmselect_title">请选择</div>');
            searchTableFunc(form, table)
        });


        setSouTableExport('副本信息');
        table.render({
            elem: "#datalist",id: "datalist"
            ,url: facade.url(ask_cert_company_detail),where: {pid:parent_pid}, page: true, height: 'full-140'
            ,soulSort: TabInit.soulSort,method: TabInit.method, toolbar: TabInit.toolbar, overflow: TabInit.overflow
            ,defaultToolbar: TabInit.defaultToolbar,filter: TabInit.filter
            ,request: TabInit.request,response: TabInit.response
            ,contextmenu:get_table_contextmenu(soulTable)
            ,text: TabInit.text
            ,parseData: function (res) {


                render_from();
                return {
                    "code": res.code,
                    "msg": res.message,
                    "count": res.data.data.total,
                    "data": res.data.data.data
                };
            }
            ,cols: [[
                {type: 'checkbox', fixed: 'left'}
                ,{type:'numbers',title:'序号',fixed:'left'}
                ,{field: 'name', title: '证书名称',width: 100}
                ,{field: 'type', title: '证书分类',width: 100}
                ,{field: 'chanid_name', title: '所属单位',width: 100}
                ,{field: 'number', title: '证书编号',width: 100}
                ,{field: 'zinumber', title: '自编号',width: 100}
                ,{field: 'issue_unit', title: '发证单位',width: 100}
                ,{field: 'expiry_dt', title: '有效期止',width: 100}
                ,{field: 'form_name', title: '证书形式',width: 100}
                ,{field: 'state_name', title: '证书状态',width: 100}
                ,{field: 'goes_name', title: '证书去向',width: 100}
                ,{field: 'store_addr', title: '证件存放地',width: 100}
                ,{field: 'custodian_name', title: '保管人',width: 100}
                ,{fixed: 'right', title:'操作', toolbar: '#test-dropdown-toolbar-barDemo',align:'center',width:200}
            ]]
            , done: function (res) {
                currTabData = res.data;
            }
        });

        listTableSearch(form, table);
    });


    function auth_but_func_show(buttitle, index){
        var trData = currTabData[index];
        openPage('show.php?id='+trData.id);
    }
    function auth_but_func_add(){
        openPageEdit('copy.php?close=1&id='+parent_pid+'&name='+encodeURI(parent_name));
    }
    function auth_but_func_edit(id){
        openPageEdit('edit.php?close=1&id='+id);
    }
    function auth_but_func_delete(id){
        data_delete(ask_cert_company_del, {id:id});
    }
</script>
</body>
</html>
